<h2><?php __('Register Application');?></h2>
<?php
if(isset($consumer)){
	print '<h3>';
		__('You have successfully registered your application');
	print '</h3>';
	
	print '<p>';
		__('Please save your authentication info');
		__('Your application id: ');
		print $consumer['consumer_id'] . '<br />';
		__('Your consumer key: ');
		print $consumer['consumer_key'] . '<br />';
		__('Your consumer secret :');
		print $consumer['consumer_secret'];
	print '</p>';
	
	print '<p>';
		__('Now you could satrt using SociALL REST API');
	print '</p>';
}
else{
	print '<p>';
		__('If you want to use SociALL REST API you should register your application');
	print '</p>';
	print $form->create('Oauths', array('class' => 'nForm wl'));

		print '<fieldset>';
		print '<div><label>' . __('App Owner Email', true) . '</label>' . $session->read('Auth.User.email') . '</div>';
		print $form->input('requester_name');
		
		// These are all optional
		print $form->input('callback_uri');
		print $form->input('application_uri');
		print $form->input('application_title');
		print $form->input('application_descr', array('type' => 'textarea'));
		print $form->input('application_notes', array('type' => 'textarea'));
		print $form->input('application_type', array('value' => 'website', 'disabled' => true));
		print $form->input('application_commercial');
		print '</fieldset>';

	print $form->end(array('label' => __('Save', true), 'div' => array('id' => 'oauthsave')));
}
?>